{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">用户</label>
        <div class="layui-input-block">
            {:Form::selectpage("row[cid]",$data.cid,'admin/custom/index','username','id',["lay-verify"=>"required"])}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">项目类型</label>
        <div class="layui-input-block">
            {:Form::selectpage("row[project_type]",$data.project_type,'admin/project_cate/index','project_cate','id',["lay-verify"=>"required"])}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">项目名称</label>
        <div class="layui-input-block">
            <input id="c-project_name" lay-verify="required" class=" layui-input" name="row[project_name]" type="text"
                   value="{$data.project_name}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">金额</label>
        <div class="layui-input-block">
            <input id="c-total_money" lay-verify="required" class=" layui-input" step="0.01" name="row[total_money]"
                   type="number" value="{$data.total_money}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">付款方式</label>
        <div class="layui-input-block">
            {:Form::select('row[type]',[1=>'对公', 2=>'微信',3=>'支付宝'], $data.type)}
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">付款类型</label>
        <dl class="layui-input-block fieldlist" data-name="row[method]" data-id="method">
            <dd>
                <button type="button" class="layui-btn btn-append">追加</button>
            </dd>
            <textarea name="row[method]" class="layui-textarea layui-hide" cols="30" rows="5">{$data.lists}</textarea>
        </dl>
    </div>


    <script type="text/html" id="methodTpl">
        <dd class="layui-form-item rules-item">
            {{# layui.each(d.lists, function(index, item) { }}

            <input type="text" class="layui-input" name="{{item.name}}[{{item.index}}][key]" placeholder="类型"
                   value="{{item.key|| ''}}"/>
            <input type="text" class="layui-input" name="{{item.name}}[{{item.index}}][value]" placeholder="金额"
                   value="{{item.value|| ''}}"/>
            <button type="button" class="layui-btn layui-btn-danger btn-remove layui-btn-xs"><i
                    class="iconfont icon-close"></i></button>
            <button type="button" class="layui-btn btn-dragsort layui-btn-xs"><i class="iconfont icon-yidong"></i>
            </button>
            {{# }); }}
        </dd>
    </script>


    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block">
            {:Form::radios('row[status]',[0=>'开发中', 1=>'已交付'],$data.status)}
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">合同</label>
        <div class="layui-input-block">
            {:Form::uploads("row[annex]",$data.annex)}
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">服务器ip</label>
        <div class="layui-input-block">
            <input id="c-ip" class=" layui-input" name="row[ip]" type="text" value="{$data.ip}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">维护到期时间</label>
        <div class="layui-input-block">
            <input id="c-expire_time" lay-verify="required" class="datetime layui-input" name="row[expire_time]"
                   type="text"  value="{$data.expire_time}">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            {:Form::textarea('row[notes]',$data.notes,["lay-verify"=>"required"])}
        </div>
    </div>


    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use('yznForm', function () {
        var yznForm = layui.yznForm;
        yznForm.bindevent($("form.layui-form"));
    });
</script>

{/block}